let marbleRaceLevel9_10 = {
	name: 'Game 9 Level 10',
	comment:'决战关',
	id: '9_10',
	type: 'value',
	valueBonus: 0,
	scoreBonus: 5,
	valueThreshold: 0,
	minPass: 1,
	objects: [
		// Portals
		{
			type: 'object',
			shape: 'rect',
			color: '@b',
			toPortal: 'a',
			x: 140,
			y: 540 - 10,
			width: 120,
			height: 20,
			valueBonus: 3
		},
		{
			type: 'text',
			content: '+3',
			color: '@background',
			x: 140,
			y: 540 - 10
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			toPortal: 'a',
			x: 260,
			y: 540 - 10,
			width: 120,
			height: 20,
			valueBonus: -1
		},
		{
			type: 'text',
			content: '−1',
			color: '@foreground',
			x: 260,
			y: 540 - 10
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@b',
			toPortal: 'a',
			x: 340,
			y: 540 - 10,
			width: 40,
			height: 20,
			valueMultiply: 1.2
		},
		{
			type: 'text',
			content: '×1.2',
			color: '@background',
			x: 340,
			y: 540 - 10
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			toPortal: 'a',
			x: 420,
			y: 540 - 10,
			width: 120,
			height: 20,
			valueBonus: -1
		},
		{
			type: 'text',
			content: '-1',
			color: '@foreground',
			x: 420,
			y: 540 - 10
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@b',
			toPortal: 'a',
			x: 540,
			y: 540 - 10,
			width: 120,
			height: 20,
			valueBonus: 3
		},
		{
			type: 'text',
			content: '+3',
			color: '@background',
			x: 540,
			y: 540 - 10
		},
		{
			type: 'object',
			shape: 'circle',
			color: '@a',
			portalID: 'a',
			x: 340,
			y: 80,
			radius: 5
		},

		// Goal portal
		{
			type: 'object',
			shape: 'circle',
			color: '@goal',
			portalID: 'goal',
			x: 700,
			y: 80,
			radius: 5
		},

		// Obstacles

		// Borders
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 0,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 400,
			y: 600,
			width: 800,
			height: 120
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 0,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 800,
			y: 300,
			width: 160,
			height: 600
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@tertiary',
			x: 640,
			y: 300,
			width: 80,
			height: 600
		},

		// Marbles
		{
			type: 'marbles',
			x: 340,
			y: 80,
			launchTime: 3,
			launchRadius: 75,
			passX: 700,
			passY: 80,
			radius: 8,
			eliminatedRadius: 6,
			velocity: 5
		},

		// Bonus blocks
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			x: 340,
			y: 900,
			width: 80,
			height: 20,
			valueMultiply: 5 / 6,
			text: {
				content: '÷1.2',
				color: '@foreground'
			},
			onCollide: function (object, marbleID, engine) {
				let pos = engine.getPosition(object.body)
				pos[0] = engine.random(100, 580)
				pos[1] = 600
				engine.setPosition(object.body, pos)
			},
			onBeforeUpdate: function (object, engine) {
				let pos = engine.getPosition(object.body)
				pos[1] -= 1
				while (pos[1] < 100) {
					pos[0] = engine.random(100, 580)
					pos[1] += 500
				}
				engine.setPosition(object.body, pos)
			}
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			x: 170,
			y: 700,
			width: 80,
			height: 20,
			valueBonus: -10,
			text: {
				content: '−10',
				color: '@foreground'
			},
			onCollide: function (object, marbleID, engine) {
				let pos = engine.getPosition(object.body)
				pos[0] = engine.random(100, 580)
				pos[1] = 600
				engine.setPosition(object.body, pos)
			},
			onBeforeUpdate: function (object, engine) {
				let pos = engine.getPosition(object.body)
				pos[1] -= 1
				while (pos[1] < 100) {
					pos[0] = engine.random(100, 580)
					pos[1] += 500
				}
				engine.setPosition(object.body, pos)
			}
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@a',
			x: 340,
			y: 600,
			width: 80,
			height: 20,
			valueBonus: -5,
			text: {
				content: '−5',
				color: '@foreground'
			},
			onCollide: function (object, marbleID, engine) {
				let pos = engine.getPosition(object.body)
				pos[0] = engine.random(100, 580)
				pos[1] = 600
				engine.setPosition(object.body, pos)
			},
			onBeforeUpdate: function (object, engine) {
				let pos = engine.getPosition(object.body)
				pos[1] -= 1
				while (pos[1] < 100) {
					pos[0] = engine.random(100, 580)
					pos[1] += 500
				}
				engine.setPosition(object.body, pos)
			}
		},
		{
			type: 'object',
			shape: 'rect',
			color: '@b',
			x: 510,
			y: 900,
			width: 80,
			height: 20,
			valueBonus: +5,
			text: {
				content: '+5',
				color: '@background'
			},
			onCollide: function (object, marbleID, engine) {
				let pos = engine.getPosition(object.body)
				pos[0] = engine.random(100, 580)
				pos[1] = 600
				engine.setPosition(object.body, pos)
			},
			onBeforeUpdate: function (object, engine) {
				let pos = engine.getPosition(object.body)
				pos[1] -= 1
				while (pos[1] < 100) {
					pos[0] = engine.random(100, 580)
					pos[1] += 500
				}
				engine.setPosition(object.body, pos)
			}
		},
	]
}
{
	let cntI = 4
	for (let i = 0; i <= cntI; ++i) {
		let cntJ = 8 + (i % 2)
		for (let j = 0; j <= cntJ; ++j)
			marbleRaceLevel9_10.objects.push({
				type: 'object',
				shape: 'circle',
				color: '@secondary',
				x: 340 + (j - cntJ * .5) * 50,
				y: 300 + (i - cntI * .5) * 50,
				radius: 5
			})
	}
}
marbleRaceLevels.push(marbleRaceLevel9_10)